{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##  _*SVM with a classical RBF kernel*_\n",
    "\n",
    "We have shown here a QSVM notebook with the classification problem solved using a quantum algorithm. By comparison this shows the problem solved classically.\n",
    "\n",
    "**This notebook shows the SVM implementation based on the classical RBF kernel.**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from matplotlib import pyplot as plt\n",
    "import numpy as np\n",
    "from qiskit.ml.datasets import ad_hoc_data, breast_cancer\n",
    "from qiskit.aqua import aqua_globals\n",
    "from qiskit.aqua.utils import split_dataset_to_data_and_labels, map_label_to_class_name\n",
    "from qiskit.aqua.algorithms import SklearnSVM"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "First we prepare the dataset, which is used for training, testing and the finally prediction.\n",
    "\n",
    "*Note: You can easily switch to a different dataset, such as the Breast Cancer dataset, by replacing 'ad_hoc_data' to 'Breast_cancer' below.*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAEICAYAAAB25L6yAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAXT0lEQVR4nO3dfZBddX3H8c+HsOoKmFWJDtkEQzuaVpNAnC1TjWXQVINKNKad1EfUzjTTaQVEJ0ziH4hMNZlmKm36YAd5EBW1EcOOgCUyBEUdBTZsTHhKVYpNNtAswgawW1nWb/845yab7T7cu3vvPb977vs1s3P3nnv37PfK+snv/J6OI0IAgHSdUHQBAICpEdQAkDiCGgASR1ADQOIIagBIHEENAIkjqJEU2x+x/cMpXv+S7b9pZk1A0QhqNIXt79l+yvYLi65lOvk/FqO2n82//tP2dbZf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0q6IW88PiLpo0UUkcz0PADAxFLq+gAATICgBoDEEdQAkDiCGgASR1ADQOIIagBIHEENAIn7P9dI4BDqyNakAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'A': 0, 'B': 1}\n"
     ]
    }
   ],
   "source": [
    "feature_dim = 2 # dimension of each data point\n",
    "training_dataset_size = 20\n",
    "testing_dataset_size = 10\n",
    "\n",
    "sample_Total, training_input, test_input, class_labels = ad_hoc_data(\n",
    "    training_size=training_dataset_size, \n",
    "    test_size=testing_dataset_size, \n",
    "    n=feature_dim, gap=0.3, plot_data=True\n",
    ")\n",
    "datapoints, class_to_label = split_dataset_to_data_and_labels(test_input)\n",
    "print(class_to_label)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "With everything setup, we can now run the algorithm.\n",
    "\n",
    "For the testing, the result includes the details and the success ratio.\n",
    "\n",
    "For the prediction, the result includes the predicted labels.  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "kernel matrix during the training:\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD6CAYAAABnLjEDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO2deXxU9dXGnwNENpGIBgirGBBFZJEAIuACoqht0RZpLVbcikVxqSLgjriiCFQL+FJFsW9UVFwqioKIr6CCrLIJssoWElD2Hfy9f8zQTybn+cHcDJkk3PP9fPiQeTg3996Ze5iZc8/vPOKcg2EYxz+livoADMNIDp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io0UkV0QW5tGqiMgkEVkW/ZuPRCnGiEhtEZkiIotFZJGI3BXVS/S5iUg5EflORL6PntdjUb2eiMyIXpNjRYSP1ynhJDXZo06wwwFcDqARgGtFRNtulhxeA9A5n9YfwGTnXAMAk6OPSxoHAdzrnGsE4DwAt0dfp5J+bvsAdHDONQXQDEBnETkPwCAAQ51z9QFsAXBzER5joZHsd/ZWAJY751Y65/YDeAtAlyQfwzHDOfcVgPwD7LoAGBP9eQwi3vUlCudctnNuTvTnHQB+AFATJfzcXISd0Ycp0T8OQAcA70b1Ende8ZLsZK8JIO8awnVR7XiimnMuO/rzRgDxG6cXQ0TkNEQsu2fgODg3ESktIvMA5AKYBGAFgK3OucNrXo/HaxKAFegKFRe51VFib3eIyIkAxgG42zkXM2K1pJ6bc+6Qc64ZgFqIfNLUi/CPU5Kd7OsB5DX5qhXVjidyRCQdAKJ/5xbx8RQIEUlBJNGznHPvReXj4twAwDm3FcAUAG0ApIrI4RnSx+M1CSD5yT4TQINo9fMEAH8C8J8kH0Nh8x8APaI/9wCgR7IUcyQy/uQVAD8454bk+acSfW4ikiYiqdGfywPohEg9YgqArtGwEnde8ZL0phoRuQLAMAClAYx2zmknhhKCiLwJ4CJEVk3lAHgUwAcA3gZQB5EVft2cc9yFopgiIu0ATAWwAMBhO9wHEPneXmLPTUSaIFKAK43IG93bzrmBInI6IsXiKgDmArjOOafteks41kFnGCHBCnSGERIs2Q0jJFiyG0ZIsGQ3jJBgyW4YIcGS3TBCgiW7YYQES3bDCAn/D0dGruT/LygpAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "testing success ratio:  0.85\n",
      "predicted classes: ['A', 'B', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', 'B', 'A', 'B', 'B', 'B', 'A']\n"
     ]
    }
   ],
   "source": [
    "aqua_globals.seed = 30\n",
    "result = SklearnSVM(training_input, test_input, datapoints[0]).run()\n",
    "print(\"kernel matrix during the training:\")\n",
    "kernel_matrix = result['kernel_matrix_training']\n",
    "img = plt.imshow(np.asmatrix(kernel_matrix), interpolation='nearest', origin='upper', cmap='bone_r')\n",
    "plt.show()\n",
    "\n",
    "print(\"testing success ratio: \", result['testing_accuracy'])\n",
    "print(\"predicted classes:\", result['predicted_classes'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### The breast cancer dataset\n",
    "Now we run our algorithm with the real-world dataset: the breast cancer dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEICAYAAABcVE8dAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAfoklEQVR4nO3df5xcdX3v8dc7yQZWgSwBjMkmEFRAkHBBVtQiBSUUaqtJweKveoPVUsttra0iobbUovdBNFW8VltFaUUf11tSGpdYtAGCqOWCEm4wETCAqJAlhIAEja4Swuf+cb5DZjczs7M7v87MeT8fj33smXPOnPM5M2c+5zvf73fOVxGBmZn1vmmdDsDMzNrDCd/MrCCc8M3MCsIJ38ysIJzwzcwKwgnfzKwgnPB7kKSQ9KI0/RlJf9PpmCqRdJqkLW3e58L0+sxo535tb34v2s8JvwUk/VjSqKSdkrZJ+oKk/cqWnynpW5J+Lmm7pG9Kev24bZyWPgwXNRJLRLwrIj7UyDaKZNx794Sk6yQt6EAc50n6r3bvN6/aVTjoRCGknZzwW+d1EbEf8FJgCPhrAElvAP4N+CIwH5gDXAK8btzzlwE/Bf57uwJuRI+V0krv3VxgG/AP1VaUNL1tUXWRHjsfekdE+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GdEPJCeMwy8giYk/CbE9krgFEkXkLUtzJS0MyIaaohvQlxIOgC4jqwgclsj8dRQz7lcWmeLpBnALODxFsUzmbiQtJjsInpqRPy6xTHVE9f+wLHAzakA8XxgjaTXR8T6DsYF2efwOxGxC/iRpHvJLgC3tzCuZ3Vzlc7twBGSDpc0k6wha02L97kGWJamlwGVvok8CJwqaYakPrIST6urdOqJ63ZgQFKpDvo1wN0tjquu2CLirRFxaEQsJKvW+WKjyb4ZcaXz6ispnmtaGEs953J5vG8AborU6tfJuCSdAHwWeH0b66NrxhURT0bEwRGxMJ1Tt6X4WpnsJ4wrGSYr3SPpYLIqngdaHNce7WwhrvePrJS8Bfg1WYPn2jR/HtlX/9J6rwXuJatX/UAb4joIWAfcB9wIzE7zh4DPx56W+s+SJfm7gY/nIa70+AxgI7AJ+AIwMy+xla1/Hu3ppVPPe/kHwC7gzrK/41sUz17nMnApWaKCrCPAvwH3A98FXtDq16jOuG5Mn9HS67MmD3GNW/dm2tBLp87XS2TVTXenz+Gb2hFX6c+3VjAzK4hurtIxM7NJcMI3MysIJ3wzs4JwwjczKwgnfDOzgnDCNzMrCCd8M7OC+P8qlYsW83ZVGAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'A': 0, 'B': 1} {0: 'A', 1: 'B'}\n"
     ]
    }
   ],
   "source": [
    "sample_Total, training_input, test_input, class_labels = breast_cancer(\n",
    "    training_size=20, test_size=10, n=2, plot_data=True\n",
    ")\n",
    "# n =2 is the dimension of each data point\n",
    "\n",
    "datapoints, class_to_label = split_dataset_to_data_and_labels(test_input)\n",
    "label_to_class = {label:class_name for class_name, label in class_to_label.items()}\n",
    "print(class_to_label, label_to_class)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "kernel matrix during the training:\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD6CAYAAABnLjEDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO2de3Cc5ZXmn6PW/S5Zsix0sWxjA3YAc3FiCAuEgIdkSMhAYAibQHapItlNapNJihk2VVtJZpMqkpkk88dS2QoTEqdCQrwwJFmKXDzEWUJCDA5gfJdtIcu6y5J1v3W33v2jW5S6z/ParVtL8nd+VS5Jx+fr79J91Orne95zxDkHwzAufDKW+gAMw0gPVuyGERCs2A0jIFixG0ZAsGI3jIBgxW4YAWFexS4it4vIMRE5ISKPLtRBGYax8Mhc77OLSAhAI4DbALQCeA3Ax5xzh8+xjdqZCP99w+KhUIjmhsOTKpaRIbN43CyamyrRaJjG8/NLVGxqKkJzC4qKVKy7s5XmZmfnkmOI0lzndHxqaormZmTo65ufX0xzGZEIex74cxaJ6Gvme37Zc+Z73fK4jrFrCACTk+Mq5rte7Hh9ueza5OYW0txoVL9GnOOPm0w4PIFoNEJf/JkpPQLn3QBOOOeaAEBEngZwJwBvsTN8Fz0nJ1/FiorKaG5X16mUHzcrK0fFysrW0NyMjNT+8Onr66Txbds+oGJDQ2d57k03qtjj//T3NLe6eoOKDQ/zxx0bG1axiYlRmssK+6qrblUxX6GdOaN/Ofl+WfT2tqtYcfEqmpuZma1ivl+akYiOT03pX3i1tZfQ7VtPH1WxsXF9DQGgsFC/HsfHR2huT89pFduy5b00d2DgjIqFw/qXEKB/ubS0+MtvPn/G1wCYeQat8ZhhGMuQ+byzp4SIPAzg4cXej2EY52Y+xd4GoG7Gz7XxWALOue8B+B7AP7MbhpEe5lPsrwHYKCLrECvy+wDcf64NRDLUZ2nf58e6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NxP6MN4yAYMVuGAFhKYv9e0u478XEzmvlcSGf2zss2Wd2wzDSi/0ZbxgBIe3FLiK3i8gxETkhIo+me/8LiYg8KSLdInJwRqxcRHaLyPH417KlPMa5ICJ1IrJHRA6LyCER+Vw8vqLPTURyReRVEdkfP6+vxuPrRGRv/DX5MxHhhv4VTlqLPT4J9nEAHwCwGcDHRGRzOo9hgfkhgNuTYo8CeNE5txHAi/GfVxoRAF90zm0GsB3AZ+LP00o/twkAtzjnrgSwFcDtIrIdwDcAfMc5dzGAswAeWsJjXDTS/c7+bgAnnHNNzrlJAE8DuDPNx7BgOOdeApA8yeFOADvj3+9EbHb9isI51+Gcez3+/RCAIwBqsMLPzcWYXkqYFf/nANwC4Jl4fMWdV6qku9hrAJye8XNrPHYhUeWcmx770glAj1RZQYhIA2Iju/fiAjg3EQmJyJsAugHsBnASQL9zbnpN9YX4mgRgAt2i4mK3Olbs7Q4RKQTwLIDPO+cGZ/7fSj0351zUObcVQC1if2leusSHlDbSXextAGauzK+Nxy4kukSkGgDiX7uX+HjmhIhkIVboTznn/i0eviDODQCcc/0A9gC4DkCpiEw3crkQX5MA0l/srwHYGFc/swHcB+CXaT6GxeaXAB6Mf/8ggF8s4bHMCYm1vfk+gCPOuW/P+K8VfW4iUikipfHv8wDchpgesQfAR+NpK+68UiXtphoR+SCAfwEQAvCkc+7raT2ABUREfgrgZsRWTXUB+DKAnwPYBaAesRV+9zrn+DjWZYqI3ADgDwAOAJjuI/YlxD63r9hzE5ErEBPgQoi90e1yzv2jiKxHTCwuB/AGgI875/g0jxWMOegMIyCYQGcYAcGK3TACghW7YQQEK3bDCAhW7IYREKzYDSMgWLEbRkCwYjeMgPD/AQf8Xkeiag3KAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "testing success ratio:  0.85\n",
      "ground truth: ['A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B']\n",
      "predicted:    ['B', 'B', 'A', 'A', 'A', 'A', 'A', 'A', 'B', 'A', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B']\n"
     ]
    }
   ],
   "source": [
    "result = SklearnSVM(training_input, test_input, datapoints[0]).run()\n",
    "print(\"kernel matrix during the training:\")\n",
    "kernel_matrix = result['kernel_matrix_training']\n",
    "img = plt.imshow(np.asmatrix(kernel_matrix),interpolation='nearest',origin='upper',cmap='bone_r')\n",
    "plt.show()\n",
    "\n",
    "print(\"testing success ratio: \", result['testing_accuracy'])\n",
    "\n",
    "print(\"ground truth: {}\".format(map_label_to_class_name(datapoints[1], label_to_class)))\n",
    "print(\"predicted:    {}\".format(result['predicted_classes']))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
